<?php
$gameSql = "SELECT * FROM ".TABLEPREFIX."_game WHERE is_active='Y'";
$gameArr = $UserManagerObjAjax->GetRecords("All",$gameSql);
$Numgame = count($gameArr);

for($x=0;$x<$Numgame;$x++)
{
   $gameArr[$x]['game_name'] = show_to_control($gameArr[$x]['game_name']);
}

$adSql = "SELECT * FROM ".TABLEPREFIX."_ads WHERE ads_position=2 AND is_active='Y' AND (ads_start_date <= '".date('Y-m-d')."' OR ads_end_date >= '".date('Y-m-d')."') ORDER BY date_added DESC";
$adArr = $UserManagerObjAjax->GetRecords('All',$adSql);
$NumAd = count($adArr);

/*echo '<pre>';
print_r($adArr);*/

$smarty->assign('Numgame',$Numgame);
$smarty->assign('gameArr',$gameArr);
$smarty->assign('adArr',$adArr);
$smarty->assign('NumAd',$NumAd);
$smarty->display('left.tpl');   

?>